<?php

namespace App\Http\Requests\Wechat;

use App\Http\Requests\ApiRequest;
use App\Models\Panx\SkinDetector;
use Illuminate\Validation\Rule;

/**
 * @property string customer_id
 * @property string openid
 * @property string store_id
 * @property string skin_detector_id
 */
class SkinRecordIndexRequest extends ApiRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'openid'           => 'required|string',
//            'appid'            => 'nullable|string',
            'skin_detector_id' => ['required', 'int', Rule::in(SkinDetector::validatedIds())],
            'customer_id'      => 'nullable|int|min:1',
            'store_id'         => 'nullable|int|min:1',
        ];
    }

}
